Skip to content

Conversation

@davidovich
Copy link

Because the store could theoretically be updated without the use of the
main AddVertex and AddEdge APIs (which does some input validation),
calculating the AdjencyMap could provoke an "assignment to entry in
nil map" panic if the store reported edges that were between unknown
vertices.

Since the edges are always between known vertices, it is an error to try
and match a missing source vertex from the vertex set. If that happens,
it is a data desynchronization error that we report to the user.

In order to test this pathological case, we needed to modify the test to
use the store directly because the "front-facing" API would not allow us
to add Edges on missing vertex.

fixes #102

Signed-off-by: davidovich [email protected]

Because the store could theoretically be updated without the use of the
main `AddVertex` and `AddEdge` APIs (which does some input validation),
calculating the `AdjencyMap` could provoke an "assignment to entry in
nil map" panic if the store reported edges that were between unknown
vertices.

Since the edges are always between known vertices, it is an error to try
and match a missing source vertex from the vertex set. If that happens,
it is a data desynchronization error that we report to the user.

In order to test this pathological case, we needed to modify the test to
use the store directly because the "front-facing" API would not allow us
to add Edges on missing vertex.

fixes dominikbraun#102

Signed-off-by: davidovich <[email protected]>
@davidovich
Copy link
Author

cc @BriannHu @suarez-agu

@dominikbraun dominikbraun self-requested a review October 24, 2023 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AdjacencyMap may cause panic

1 participant